---
archived: false
title: Foo Window Manager
date: 2014-02-12
description: Minimal IPC/DSL-based Zooming Wm
category: linux
status: 'experimental'
links:
    'Source' : http://github.com/mil/foo-wm
    'Foo DSL Docs' : https://github.com/mil/foo-wm/blob/master/FOO-DSL.md
    'Aur PKGBUILD' : https://aur.archlinux.org/packages/foo-wm-git/
sort_index: 100
footnotes:
    - '<a href="https://github.com/patrickhaller/no-wm">no-wm</a> is an amazing proof-of-concept.'
    - "Bastein stated on the <a href='http://herbstluftwm.org/archive/msg00054.html'>herbluftwm mailing list</a> that <a href='https://github.com/baskerville/bspwm'>Bspwm</a>'s server/client IPC skeleton was originally extracted from <code>foo-wm</code>! Although, <a href='https://github.com/baskerville/bspwm'>Bspwm</a> has evolved much since then, it's nice to know <code>foo-wm</code> served as an inspiration."
---

[Foo Wm](http://github.com/mil/foo-wm) was an idealistic &amp; minimalistic wm for X11 which I built over the course of a summer while doing [Hacker School](http://hackerschool.com).  The architecture of the wm was simple, involving only two components:

- A tree data structure to hold windows **and**
- A DSL to manipulate &amp; traverse the window tree

In `foo-wm` 'tiling' and 'floating' modals of organization familiar in WIMP were just setting values of containers.  'Workspaces' were just the immediate containers of the root node.  And 'full-screening' a window meant simply issuing a `zoom` DSL command with a high positive delta. 

<div class='captioned-image'>
<img src="/assets/prj_img/foo_wm/kind-of-busy.png" alt="Screenshot of Foo-Wm">
<span class='caption'>Meta: at work, using `foo-wm` to edit `foo-wm`'s code.</span>
</div>



<div class='captioned-image'>
<img src="/assets/prj_img/foo_wm/node-sketch.jpg" alt="Representation of Foo-wm nodes">
<span class='caption'>Workspace's didn't exist within `foo-wm`, because given the tree structure they were easily emulated using the `zoom` command.</span>
</div>


The [Foo DSL](https://github.com/mil/foo-wm/blob/master/FOO-DSL.md), accessible via a socket, was the only way to interact with `foo-wm` itself. In fact, `foo-wm` didn't even provide a way to bind keys to wm actions, because [xbindkeys](https://github.com/mil/foo-wm/blob/master/config/.xbindkeysrc) could and still can do that anyway.

All commands in the [Foo DSL](https://github.com/mil/foo-wm/blob/master/FOO-DSL.md) operated on two pointer nodes within the tree. The <code>active node</code> controlled the node currently through-putting mouse and keyboard events; and the <code>view node</code> represented the node that the screen was currently displaying. The [full DSL](https://github.com/mil/foo-wm/blob/master/FOO-DSL.md) was as follows:



|Command   |Targets Node | Purpose |
|:---------|:------------|:--------|
|zoom      | `view node` | Zooms screen through tree. |
|containerize | `focus node` | Wraps current node in a new parent node. |
|focus | `focus node` | Moves focus pointer to brother in focus node's parent. |
|shift | `focus node` | Moves focus node's parent position relative to its parent. |
| kill | `focus node` | Removes focus node window from tree. |
| mark | `view node` | Sets a bookmark on the current viewnode. |
| jump | `view node` | Restores a bookmark of viewnode set with `mark`. |

After building `foo-wm` I used it for about a year on and off. Being my first major serious C project; I learned to about `malloc`, `free`, and `memset` the hard way -- watching my windows crash and burn.  

I've since stopped using `foo-wm` because I was too lazy to implement full [EWMH](http://standards.freedesktop.org/wm-spec/wm-spec-latest.html) window hinting, which substantially limited the number of applications I could use within `foo-wm` without annoyance.

When I go to build my next wm I'll likely scrap `foo-wm` and take a completely different approach<sup>1</sup> to a meta-wm/DSL-based-wm altogether.

While Foo Wm may be dead, it spirit lives on in some form. The `0.1` release of [Bspwm](https://github.com/baskerville/bspwm), a popular tree-based wm within the Arch community, was influenced in part from the server/client architecture that I built into `foo-wm`<sup>2</sup>.